package xin.cms.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import xin.cms.enums.CheckStatus;
import xin.cms.enums.NoticeType;
import xin.core.jpa.JpaConstant;
import xin.core.jpa.model.AutoDateUUIDEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * <pre>
 * 通知
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2018/8/10
 */
@Entity
@Table(name = "cms_notice")
@Data
@EqualsAndHashCode(callSuper = true)
public class Notice extends AutoDateUUIDEntity {

    /**
     * 标题
     */
    @Column(length = JpaConstant.CommonStringMidLength)
    private String title;

    /**
     * 内容
     */
    @Column(columnDefinition = "longtext")
    private String content;

    /**
     * 类型
     * @see NoticeType
     */
    @Column(name = "type_",length = JpaConstant.EnumStringLargeColumnLength)
    private NoticeType type;

    /**
     * 阅读次数
     */
    @Column
    private Integer readTimes;

    /**
     * 来源
     */
    @Column(length = JpaConstant.CommonStringLargeLength)
    private String sourceInfo;

    /**
     * 来源地址
     */
    @Column(length = JpaConstant.CommonStringLargeLength)
    private String sourceUrl;

    /**
     * 置顶
     */
    @Column
    private Boolean isTop;

    /**
     * 图片/轮播图
     */
    @Column(length = JpaConstant.CommonStringMidLength)
    private String sowingMap;

    /**
     * 状态
     * @see CheckStatus
     */
    @Column(length = JpaConstant.EnumStringShortColumnLength)
    private CheckStatus status;

    /**
     * 备注
     */
    @Column(length = JpaConstant.CommonStringLargeLength)
    private String remark;
}
